NativeAd

Interface representing a native ad for mediation.

Implementations of this interface should provide information about the native ad's assets such as title, description, sponsor text, call to action text, rating, icon URI, main image URI, and video view. These properties should return null in case the ad is not loaded, the asset is not available in the bid response, or not preloaded successfully.

Types

Link copied to clipboard
interface Assets

Encapsulates all asset-related properties for the ad.

Link copied to clipboard

Listener to be informed of onImpressionHandled or onGeneralClickHandled events.

Properties

Link copied to clipboard
abstract val assets: NativeAd.Assets?

Access to the ad's assets.

Link copied to clipboard

Register this listener to be informed of onImpressionHandled or onGeneralClickHandled events.

Link copied to clipboard
abstract val isLoaded: Boolean

Property indicating if the ad is loaded

Functions

Link copied to clipboard
abstract fun destroy()

Release all resources held by this object, and prevent further use.

Link copied to clipboard
abstract fun handleGeneralAdClick()

Call this when the adapter's view implementation gets clicked.

Link copied to clipboard
abstract fun handleImpression()

Call this when the adapter's view (or some of the asset views, it's up to you to decide) gets rendered.

Link copied to clipboard
abstract fun load(bidResponseJson: String, listener: AdLoad.Listener?)

Loads the ad with the specified bidResponseJson and listener. If the ad is currently being displayed, the underlying ad object will be destroyed before loading a new one.